<!DOCTYPE html>
<html lang="en">
<head>
    <title>无线路由管理平台</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="css/unicorn.main.css" />
    <link rel="stylesheet" href="css/unicorn.grey.css" class="skin-color" />

    <link rel="stylesheet" href="/css/theme1/jquery-ui-1.10.4.custom.css" />
    <link rel="stylesheet" href="/css/ui.jqgrid.css" />
    <link rel="stylesheet" href="/css/jquery.qtip.min.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>

<%include inc.html%>

<div id="content">

    <div id="breadcrumb">
        <a href="index.html" title="返回控制台" class="tip-bottom"><i class="icon-home"></i> 无线路由管理平台</a>
        <a href="#" class="current">权限分级管理</a>


    </div>
    <div class="container-fluid">


        <div class="row-fluid">
            <div class="span12">
                <div style="margin: 0 auto;"  class="alert alert-block alert-<%if(typeof(retdata.success)!="undefined" && retdata.success==false){%>error<%}else{%>info<%}%>" id="info">
                    <i class="  icon-cog"></i>
                    <%=retdata.info %>
                    <a href="#" data-dismiss="alert" class="close">×</a>
                </div>
            </div>
        </div>


        <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                        <span class="icon">
                            <i class="icon-align-justify"></i>
                        </span>
                    <h5>权限分级管理
                        <span class="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数目限制：-1表示无限制。</span></h5>

                    <span class="label label-important"></span>
                </div>
                <div class="widget-content nopadding">
                    <form class="form-horizontal" method="post" name="roleinfo" id="roleinfo" novalidate="novalidate" />

                    <input id="oper" style="display: none" name="oper">
                    <input id="id" style="display: none" name="id">

                    <div class="control-group">
                        <label class="control-label">权限名称</label>
                        <div class="controls">
                            <input type="text" name="rolename" id="rolename"
                                   value="<%if(typeof(role.rolename)!=="undefined" && !!role.rolename ){%><%=role.rolename%><%}%>"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">权限类型</label>
                        <div class="controls">
                            <select  name="flag" id="flag">
                                <option value="0" <%if(typeof(role.flag)!=="undefined" && !!role.flag && role.flag==0 ){%>selected<%}%>/>普通商户
                                <option value="1" <%if(typeof(role.flag)!=="undefined" && !!role.flag && role.flag==1 ){%>selected<%}%> />代理商
                                <option value="99" <%if(typeof(role.flag)!=="undefined" && !!role.flag && role.flag==99 ){%>selected<%}%>/>系统管理
                            </select>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">下属权限分级</label>
                        <div class="controls">
                            <label >
                                <input value="0" type="checkbox" name="childroleid" id="childroleid"
                                <%if(0==role.childroleid){%>
                                <%='checked'%>
                                <%}%>>
                                <STRONG class="checker red" class="lbl green">无下属权限分级</STRONG></label>

                            <input id="rolelistnum" style="display: none" name="rolelistnum" value="<%=retdata.rolelist.length%>">
                            <% retdata.rolelist.forEach(function(post, index){%>
                                <label >

                                    <input value="<%=post.id%>" type="checkbox" name="childroleid" id="childroleid"
                                    <%if((role.childroleid.split(',')).indexOf(post.id+'')!==-1){%>
                                    <%='checked'%>
                                    <%}%>>
                                    <span class="checker blue" class="lbl" id="a<%=index%>" class="green"  data-hasqtip="title"><%=post.rolename%></span></label>

                                <div class="tooltiptext<%=index%>" style="display: none">
                                    权限分级名称：<%=post.rolename%>
                                    <BR><BR>可配置下属商户数：<%if(post.usernumber==-1){%>无限制<%}else{%><%=post.usernumber%>个<%}%>
                                    <BR><BR>可配置wifi数：<%if(post.wifinumber==-1){%>无限制<%}else{%><%=post.wifinumber%>个<%}%>
                                    <BR><BR>可配置ap数：<%if(post.apnumber==-1){%>无限制<%}else{%><%=post.apnumber%>个<%}%>
                                    <BR><BR>可配置认证权限： <%-post.authnumber%>
                                    <BR><BR>可配置广告数：<%if(post.adnumber==-1){%>无限制<%}else{%><%=post.adnumber%>个<%}%>
                                    <BR><BR>统计权限：<%-post.statnumber%>
                                    <BR><BR>收费标准：<%=post.fee%>元
                                </div>
                            <%})%>
                            代理商也可以选择代理商作为下属。如果选择《无下属权限分级》则其他选择无效。可以选择多个下属权限分级。
                        </div>
                    </div>



                    <div class="control-group">
                        <label class="control-label">下属商户数</label>
                        <div class="controls">
                            <input type="text" name="usernumber" id="usernumber"
                                   value="<%if(typeof(role.usernumber)!=="undefined" && role.usernumber!==null ){%><%=role.usernumber%><%}%>"/>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">热点数</label>
                        <div class="controls">
                            <input type="text" name="wifinumber" id="wifinumber"
                                   value="<%if(typeof(role.wifinumber)!=="undefined" && !!role.wifinumber ){%><%=role.wifinumber%><%}%>"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">认证权限</label>
                        <div class="controls">
                            <% retdata.authlistemun.forEach(function(post, index){%>
                            <label><input value="<%=post.key%>" type="checkbox" name="authnumber" id="authnumber"
                                <%if(post.key == -1 && role.authnumber == -1){%>
                                    <%='checked'%>
                                <%}else if((role.authnumber & post.key)!==0
                                && post.key !== -1
                                && role.authnumber !== -1){%>
                                    <%='checked'%>
                                <%}%>>
                            <span class="checker blue" class="lbl"><%=post.value%></span></label>
                            <%})%>
                            <span class="red">说明：如果同时选择“无限制”和其他权限则默认设置为“无限制”。</span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">AP数</label>
                        <div class="controls">
                            <input type="text" name="apnumber" id="apnumber"
                                   value="<%if(typeof(role.apnumber)!=="undefined" && !!role.apnumber ){%><%=role.apnumber%><%}%>"/>
                            <span class="red">说明：-1表示不限制，下同。</span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">广告数</label>
                        <div class="controls">
                            <input type="text" name="adnumber" id="adnumber"
                                   value="<%if(typeof(role.adnumber)!=="undefined" && !!role.adnumber ){%><%=role.adnumber%><%}%>"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">统计权限</label>

                        <div class="controls">
                            <% retdata.statlistemun.forEach(function(post, index){%>
                            <label><input value="<%=post.key%>" type="checkbox" name="statnumber" id="statnumber"
                                <%if(post.key == -1 && role.statnumber == -1){%>
                                    <%='checked'%>
                                <%}else if((role.statnumber & post.key)!==0
                                    && post.key !== -1
                                    && role.statnumber !== -1){%>
                                        <%='checked'%>
                                <%}%>>
                                <span class="checker blue" class="lbl"><%=post.value%></span></label>
                            <%})%>
                            <span class="red">说明：如果同时选择“无限制”和其他权限则默认设置为“无限制”。</span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">有效期（月）</label>
                        <div class="controls">
                            <input type="text" name="validmonth" id="validmonth"
                                   value="<%if(typeof(role.validmonth)!=="undefined" && !!role.validmonth ){%><%=role.validmonth%><%}%>"/>
                            月
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">费用标准（元）</label>
                        <div class="controls">
                            <input type="text" name="fee" id="fee"
                                   value="<%if(typeof(role.fee)!=="undefined"  ){%><%-role.fee%><%}%>"/>
                            元
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">描述</label>
                        <div class="controls">
                            <input type="text" name="descs" id="descs"
                                   value="<%if(typeof(role.descs)!=="undefined" && !!role.descs ){%><%=role.descs%><%}%>"/>
                        </div>
                    </div>

                    <div class="form-actions">
                        <input type="submit" value="提交" class="btn btn-danger" />
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    </div>
    <div class="row-fluid">
        <div id="footer" class="span12">
            2014 &copy; 无线广告路由云管理平台
        </div>
    </div>
</div>

<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>

<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.validate.js"></script>
<script src="js/unicorn.js"></script>
<script type='text/javascript' src='js/bootbox.min.js' charset='utf-8'></script>
<script src="js/jquery.qtip.min.js"></script>
<script src="js/unicorn.roleinfo.js"></script>
</body>
</html>
